<ui:composition template="/templates/layout.xhtml" 
	xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:fmt="http://java.sun.com/jstl/fmt"
    xmlns:x="http://java.sun.com/jstl/xml"
    xmlns:fn="http://java.sun.com/jstl/functions"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:gape="http://componentes.gape/component/gape">
     
	<ui:define name="titulo">
		<h:outputText value="#{msg.applicationName} - #{msg.titleTelaSearchOrganization}" />
	</ui:define>

	<ui:define name="menu">
		<c:choose>
			<c:when test="${strategy.strategyChosen}">
				<ui:include src="/menu/menuStrategicPlan.xhtml" />					
			</c:when>						
		</c:choose>		
	</ui:define>
	
	<ui:define name="conteudo">
		<h:panelGrid columns="1">
			<rich:dataTable id="organizationTable" columnClasses="" headerClass="headTable" rowClasses="odd,even" 
							value="#{organization.listOrganization}" var="row" rows="15">
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.nameTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.nome}" />
				</rich:column>
				
				<rich:column>
					<f:facet name="header">
						<h:outputText value="#{msg.adminNameTitleColumn}" />
					</f:facet>
					<h:outputText value="#{row.nomeAdministrador}" />
				</rich:column>
				
				<rich:column>
					<h:commandLink action="#{organization.preparaTelaEdicao}" value="#{msg.buttonView}" styleClass="buttonLink">
						<f:setPropertyActionListener value="#{row.nome}" target="#{organization.nome}" />
						<f:setPropertyActionListener value="#{row.missao}" target="#{organization.missao}" />
						<f:setPropertyActionListener value="#{row.visao}" target="#{organization.visao}" />
						<f:setPropertyActionListener value="#{row.idAdmin}" target="#{organization.admin}" />
						<f:setPropertyActionListener value="#{row.listaValoresOrganizacao}" target="#{organization.listValues}" />
						<f:setPropertyActionListener value="#{row.id}" target="#{organization.id}" />
						<f:setPropertyActionListener value="#{false}" target="#{organization.menuSaveDisabled}" />
					</h:commandLink>
				</rich:column>
				
	 			<f:facet name="footer">
	                <rich:datascroller maxPages="20">
	                </rich:datascroller>
	            </f:facet>
			</rich:dataTable>
		</h:panelGrid>		
	</ui:define>
	
	<ui:define name="menuTela">
		<ui:include src="menu.xhtml" />
	</ui:define>
	
	<ui:define name="menuNavegacaoBack">
		<gape:navigationBack mbean="#{'organization'}" metodo="#{'redirecionaBack'}"/>
	</ui:define>
	
	<ui:define name="menuNavegacaoForward">
		<gape:navigationForward action="#" disabled="#{true}"/>
	</ui:define>

	<ui:define name="includePanels"></ui:define>
</ui:composition>